/**
 * 基金相关接口
 */

import request from '@/utils/request';

/**
 * @description - 捐助统计
 * @param {string} patientId - 用户id
 * @returns
 */
export function publicBenefitDonationStat(patientId) {
  return request({
    url: '/publicBenefitDonation/stat',
    params: {
      patientId
    }
  });
}

/**
 * @description 捐助历史
 * @param {*} data
 * @returns
 */
export function publicBenefitDonationHistory(data) {
  return request({
    url: '/publicBenefitDonation',
    params: data
  });
}

/**
 *
 * @description 公示
 */
export function disclosure() {
  return request({
    url: '/publicBenefitDonation/disclosure',
    noAuth: true
  });
}

/**
 * @description - 受益人故事模块
 * @param {*} data
 * @returns
 */
export function getArticles(data) {
  return request({
    url: '/wcm/articles',
    noAuth: true,
    params: data
  });
}

/**
 * @description - 捐款
 * @param {*} patientId - 用户ID
 * @param {*} location - 地址信息
 * @param {*} data - 支付信息
 * @returns
 */
export function publicBenefitDonation(patientId, data) {
  return request({
    method: 'post',
    url: `/patient/${patientId}/publicBenefitDonation`,
    params: {
      location: ''
    },
    data,
    noqs: true,
    headers: {
      'Content-Type': 'application/json'
    }
  });
}
